package com.finance.system.nio;

import java.nio.channels.SelectionKey;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SocketChannelWrapperMap {
    private static Map<SelectionKey,SocketChannelBufferedWrapper> map = new ConcurrentHashMap();

    public static SocketChannelBufferedWrapper getWrapper(SelectionKey key){
        if(map.get(key) == null){
            SocketChannelBufferedWrapper wrapper = new SocketChannelBufferedWrapper(4,
                    200);
            map.put(key,wrapper);
        }
        return map.get(key);
    }

}
